The technology described herein relates to the processing of graphics, and in particular to the processing of 3-dimensional (3D) graphics, for, e.g., display on a display screen.
As is known in the art, graphics processing typically involves carrying out a sequence of operations on graphics data to generate the final image that is displayed. These operations are often carried out in a pipelined fashion. For example, two common stages of a graphics processing pipeline are so-called vertex shading operations that are carried out on the vertices of primitives (polygons) representing the image to be displayed, and the subsequent fragment (pixel) shading operations that shade (colour) the individual fragments (pixels) that make up the image to be displayed.
Typically, in these processes, once the input data values for a scene have been vertex “shaded”, the primitives representing the scene are then usually rasterised to generate an array of “fragments” to be processed for the scene. (As is known in the art, “fragments” are the discrete graphical entities on which the graphics processing operations (such as rendering) are carried out. Each fragment will correspond to a sampling point or sampling points of the scene and have associated with it the necessary data, such as red, green, blue (RGB) colour values, an alpha (transparency) value, and a depth value, to allow the sample point(s) to be displayed. (Fragments may also be referred to as pixels, although it is not inevitably the case that a given fragment will correspond exactly to a single pixel (pixel element) in the final display, as overdraw, blending, multi-sample anti-aliasing, or post-processing, such as down-scaling, may mean that there is not a one-to-one correspondence between the entities (fragments) that the graphics processing operates on and the display pixels.))
The graphics fragments, once generated, undergo a number of “rendering” processes to shade them to generate their final output colour, etc., values. Such processes to derive the output data values may be referred to as “fragment shading” or “pixel shading” and are carried out in a fragment shading (also called a pixel shading) stage of the processing pipeline.
As is known in the art, one common technique involves controlling the graphics processing system to generate and store an array of graphics data in a first rendering pass. Then, in a subsequent rendering pass, e.g. in which the scene is processed for its final display, the array of graphics data is used, e.g. as a texture, e.g. to generate the final output colour values for display. Textures may be used in this manner, for example, to provide data that relates to views of the scene from different angles, such as a shadow maps.
FIG. 1 shows an exemplary graphics data generation process. In FIG. 1 a scene 1 to be rendered is being viewed from a viewpoint 2. However, the scene is also to be illuminated by two light sources 3, 4.
As is known in the art, in order to apply the effects of the light sources 3, 4 on the scene when it is displayed, so called “shadow maps” (which are a form of texture map) in respect of each light source will be applied to the rendered image.
In order to generate a shadow map, the scene will typically be rendered in a first pass as if viewed from the position of the light source to which the shadow map corresponds, so as to generate a texture map that can then be applied to the scene to in effect represent the effect of the shadows cast by the light source when viewed from the viewpoint for the scene.
Thus in the case of the scene shown in FIG. 1, the graphics processor will first be controlled to render the scene in relation to the light source 4, so as to generate a shadow map 5 representing the effect of that light source on the scene, and to store the shadow map 5 in memory. Then the graphics processor will similarly be controlled to render the scene in relation to the light source 3, so as to generate a shadow map 6 representing the effect of that light source on the scene, and to store the shadow map 6 in memory.
Then, the scene will be rendered for its final display, the rendering process will read the generated shadow maps 5, 6 from memory, and use them for the scene as it is rendered, in order to reflect the effect of the light sources 3, 4 on the scene as it is viewed from the viewpoint 2.
In other words, the rendering of the scene for display will use the previously generated shadow maps 5, 6, so as to apply the effects of the light sources 3, 4 on the scene as it is displayed.
In these methods, it is necessary to provide and allocate sufficient memory to store all the intermediate graphics data (e.g. the texture maps, etc.) that is generated when rendering the scene. This can create a relatively large overhead in terms of the memory footprint required to store all the data required for a scene. Equally, the processes of writing the intermediate data to memory, and subsequently reading it from memory when it is needed (e.g. when processing the scene for final display), can be expensive in terms of bandwidth and power consumption.
The Applicants believe therefore that there remains scope for improvements to techniques for processing graphics data, and in particular in arrangements where intermediate graphics data, such as textures, are to be generated and used when rendering frames for output.
Like reference numerals are used for like components in the drawings, where appropriate.